package xworker.gluon.glisten.control;

import com.gluonhq.charm.glisten.control.ProgressBar;
import org.xmeta.ActionContext;
import org.xmeta.Thing;
import xworker.javafx.control.ProgressIndicatorActions;

public class ProgressBarActions {
    public static void init(ProgressBar node, Thing thing, ActionContext actionContext){
        ProgressIndicatorActions.init(node, thing, actionContext);
    }

    public static ProgressBar create(ActionContext actionContext) {
        Thing self = actionContext.getObject("self");
        ProgressBar node = new ProgressBar();
        init(node, self, actionContext);

        actionContext.peek().put("parent", node);
        for (Thing child : self.getChilds()) {
            child.doAction("create", actionContext);
        }

        actionContext.g().put(self.getMetadata().getName(), node);
        return node;
    }
}
